import {post, get, message, history} from '@/utils/utils'

const withdrawals = {
  namespaced: true,
  state: {

  },

  mutations: {
    save(state, { field, payload }) {
      if (Object.prototype.toString.call(payload) === '[object Object]') {
        state[field] = { ...state[field], ...payload }
      } else {
        state[field] = payload
      }
    }
  },

  actions: {
    verify({ commit }, payload) {
      post({api: '/agt/agentinfoPaymentWord/checkSelfIdentity',
        data: payload,
        success: ({data, code}) => {
          history.push('/pages/setPassword/setPassword')
        }})
    }
  }
}

export default withdrawals
